class Dog {
    #_name;
    #_age;

    constructor() {

    }

    say(){
        console.log(this.name);
    }

    get name() {
        return this.#_name;
    }

    set name(value) {

        this.#_name = value+"aa";
    }

    get age() {
        return this.#_age;
    }

    set age(value) {
        console.log(value)
        this.#_age = value+1;
    }
}

let d = new Dog();
// Object.defineProperty(d, "age", {
//     age: 0,
//     set(v) {
//         console.log(v);
//         age = v+v;
//     },
//     get() {
//         return age;
//     }
// });
d.age = 10;
console.log(d.age)